<%@page import="com.exam.dao.QuestionDbDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
 <link href="css/style.css" rel="stylesheet" type="text/css" />
 <link href="css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-2.0.js"></script>
<script type="text/javascript" src="js/select-ui.min.js"></script>

<script type="text/javascript">
$(document).ready(function(e){
 
 	 $(".select1").uedSelect({
		width : 345			  
	});
	$(".select2").uedSelect({
		width : 180  
	});
	$(".select3").uedSelect({
		width : 100
	});
 
 
  var url = "#";
  $(".click").click(function(){
  		$(".tip").fadeIn(200);
  		url = this.href;
  		return false;
  });
  
  $(".tiptop a").click(function(){
 		 $(".tip").fadeOut(200);
	});

  $(".sure").click(function(){
  		$(".tip").fadeOut(100);
  		location.href = url;
	});

  $(".cancel").click(function(){
 		$(".tip").fadeOut(100);
	});
	
	});


</script>
</head>
<body>	
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="index.jsp">首页</a></li>
    <li><a href="#">试题管理</a></li>
    <li><a href="#">试题列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <a href="question-save.jsp" title="添加试题"><li><span><img src="images/t01.png" /></span>添加</li></a>
        <li><span><img src="images/t02.png" /></span>修改</li>
        <li><span><img src="images/t03.png" /></span>删除</li>
        </ul>
        
        
        <ul class="toolbar1">
        <li><span><img src="images/t05.png" /></span>设置</li>
        </ul>
    
    </div>
  <form action="question-list.action">
    <ul class="seachform">
    <li><label>综合查询</label><input name="key" type="text" class="scinput" /></li>
    <li>
    <label>题库</label>  
    	<%
   			//获取题库列表
   			QuestionDbDao qd = new QuestionDbDao();
   			request.setAttribute("DBList", qd.getDBList());
   		 %>
   		 <div class="vocation">
	   		 <select class="select2" name="dbid">
	   		 <option value="null">全部</option>
	    	<s:iterator value="#request.DBList" status="gb">
	    			<option value="<s:property value="id"/>"><s:property value="db_name"/></option>
	    	</s:iterator>
		    
	  	  	</select>
	    </div>	
    </li>
    
    <li>
	    <label>试题状态</label>  
	    <div class="vocation">
		    <select name="status" class="select3" >
		    <option value="">全部</option>
		    <option value="1" >启用</option>
		    <option value="0" >禁用</option>
		    </select>
	    </div>
    </li>
    
    <li><label>&nbsp;</label><input  type="submit" class="scbtn" value="查询"/></li>
    </ul>
    </form>
     <table class="tablelist">
    	<thead>
    	<tr>
        <th>编号<i class="sort"><img src="images/px.gif" /></i></th>
        <th>试题题干</th>
        <th>正确选项</th>
        <th>答案解析</th>
        <th>所属题库</th>
        <th>状态</th>
        <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <s:if test="#request.QuestionList!=null">
        <s:iterator value="#request.QuestionList" status="list">
        <tr>
		        <td><s:property value="id"/></td>
		        <td><s:property value="content"/></td>
		        <td><s:property value="answer"/></td>
		        <td><s:property value="answer_info"/></td>
		        <td><s:property value="db_name"/></td>
		        <td>
		         <s:if test="1==status">
		        	<a href="question-changeStatus.action?qid=<s:property value="id"/>&status=0" title="点击切换状态" class="green">已启用</a>
		        </s:if>
		        <s:else>
		        	<a href="question-changeStatus.action?qid=<s:property value="id"/>&status=1" title="点击切换状态" class="red">已禁用</a>
		        </s:else>
		        
		        </td>
		        <td>
		        <a href="#" class="tablelink" >查看</a>   
		        <a href="question-edit.action?dbid=<s:property value="dbid"/>&qid=<s:property value="id"/>" class="tablelink">修改</a>  
		        <a href="question-delete.action?qid=<s:property value="id"/>" class="tablelink click" > 删除</a></td>
        </tr> 
        </s:iterator>
        </s:if>
        <s:else>
        	<tr>
        		<td colspan="7">暂无本类数据...</td>
        	</tr>
        </s:else>
           
        </tbody>
    </table>
    
    <div class="pagin">
    	<div class="message">
    		${pageInfo }
    	</div>
        ${pageList }
    </div>
    
    
    <div class="tip">
     <div class="tiptop"><span>提示信息</span><a></a></div>
      <div class="tipinfo">
        <span><img src="images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认对信息的修改 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
      </div> 
    </div>
</body>
</html>
